<extend name="Public/base"/>

<block name="body">

    <script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
    <div class="main-title cf">
        <h2> 新增 [相册分类] </h2>
    </div>
    <div class="tab-content">
        <form action="{:U('updateCategory')}" method="post" class="form-horizontal fl">
            <div class="form-item cf">
                <label class="item-label">名称<span class="check-tips">（指定分类的名称）</span></label>
                <div class="controls">
                    <input type="text" class="text input-medium" name="title" placeholder="如：桂林景点大全" value="{$info.title|default=''}">
                </div>
            </div>
            <div class="form-item cf">
                <label class="item-label">SEO标题<span class="check-tips">（用于搜索引擎收录的标题显示）</span></label>
                <div class="controls">
                    <input type="text" class="text input-medium" name="meta_title" placeholder="如：最全的桂林旅游景点风景集_最美桂林风景" value="{$info.meta_title|default=''}">
                </div>
            </div>
            <div class="form-item cf">
                <label class="item-label">SEO关键词<span class="check-tips">（用于搜索引擎收录的关键词）</span></label>
                <div class="controls">
                    <input type="text" class="text input-medium" name="keywords" placeholder="如：桂林,风景,景点,美景,高清图" value="{$info.keywords|default=''}">
                </div>
            </div>
            <div class="form-item cf">
                <label class="item-label">分类描述<span class="check-tips">（用于展示分类时的简单描述，也会用于利于搜索引擎的SEO描述）</span></label>
                <div class="controls">
                    <textarea name="description" id="description" cols="30" rows="10">{$info.description|default=''}</textarea>
                </div>
            </div>
            <div class="form-item cf">
                <label class="item-label">每页显示数量<span class="check-tips">（指定分类下的每页显示的相册数量）</span></label>
                <div class="controls">
                    <input type="number" name="list_row" value="{$info.list_row|default='10'}" >
                </div>
            </div>

            <div class="form-item cf">
                <label class="item-label">列表页模版<span class="check-tips">（指定该分类下的相册列表页面模版）</span></label>
                <div class="controls">
                    <input type="text" class="text input-medium" name="template_lists" placeholder="如：" value="{$info.template_lists|default=''}">
                </div>
            </div>
            <div class="form-item cf">
                <label class="item-label">详情页模版<span class="check-tips">（指定该分类下的相册详情页面模版）</span></label>
                <div class="controls">
                    <input type="text" class="text input-medium" name="template_detail" placeholder="如：" value="{$info.template_detail|default=''}">
                </div>
            </div>
            <div class="form-item cf">
                <label class="item-label">可见性设置<span class="check-tips">（指定什么情况下可以查看该分类下的相册）</span></label>
                <div class="controls">
                    <select id="display" name="display">
                            <option value="0" >仅后台可见</option>
                            <option value="1" >前台可见</option>
                            <option value="2" >前台登录可见</option>
                    </select>
                    <script>
                        //设置选中项
                        $(document).ready(function(){
                            var categoryDisplay = '{$info.display|default="1"}';
                            if(categoryDisplay == '1'){
                                $("#display").find("option[value='1']").attr('selected','selected');
                            }else{
                                $("#display").find("option[value='{$info.display}']").attr('selected','selected');
                            }
                        });
                    </script>
                    <span style="color: #ffffff; background-color: #f89406;padding:0 5px;">请确认选择</span>
                </div>
            </div>

            <div class="form-item cf">
                <button class="btn submit-btn ajax-post hidden" id="submit" type="submit" target-form="form-horizontal">确 定</button>
                <a class="btn btn-return" href="">返 回</a>
                <input type="hidden" name="id" value="{$info.id|default=''}"/>
            </div>
        </form>
    </div>
</block>